
	
	function onDeviceReady_exitlogin() {
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS_exitlogin, fail);
    }

    function gotFS_exitlogin(fileSystem) {
        fileSystem.root.getFile("userkey.txt", {create: true, exclusive: false}, gotFileEntry_exitlogin, fail);
    }

    function gotFileEntry_exitlogin(fileEntry) {
        fileEntry.createWriter(gotFileWriter_exitlogin, fail);
    }

    function gotFileWriter_exitlogin(writer) {
        writer.onwriteend = function(evt) {
            console.log("contents of file now 'some sample text'");
            writer.truncate(11);  
            writer.onwriteend = function(evt) {
                console.log("contents of file now 'some sample'");
                writer.seek(4);
                writer.write("phone:null userkey:null");
                writer.onwriteend = function(evt){
                    console.log("contents of file now 'some different text'");
                }
            };
        };
        writer.write("some sample text");
    }
